import request from "@/utils/request.js"

export default{

  findById(id){
    return request({
      url:`/processCompound/${id}`,
      method:'get'
    });
  },
  findAllByType(type,page,size){
    return request({
      url:`/processCompound/${type}/${page}/${size}`,
      method:'get'
    });
  },
  deleteById(id){
    return request({
      url:`/processCompound/${id}`,
      method:'delete'
    });
  },
  save(processCompound){
    return request({
      url:`/processCompound`,
      method:'post',
      data:processCompound
    });
  },
  update(id,processCompound){
    if(id==''){
      return this.save(processCompound)
    }
    return request({
      url:`/processCompound/${id}`,
      method:'put',
      data:processCompound
    });
  },
  search(searchMap,page,size){
    return request({
      url:`/processCompound/search/${page}/${size}`,
      method:'post',
      data:searchMap
    });
  },
  updateState(id){
    return request({
      url:`/processCompound/state/${id}`,
      method:'put'
    });

  }


}
